#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

#define int long long

ll n;
int cnt = 0;

mt19937 rnd(time(NULL));

ll lst = 0, C = 0;

ll tabs(ll x) { return x < 0 ? -x : x; }

int ask(ll x) {
	++cnt;
	//cout << "? "<< x << endl;
	ll res = tabs(x - lst) >= C; /*cin >> res; cerr << x << " " << abs(x - lst) << " " << res << endl; */ lst = x; return res;
}

void solve(ll st) {
	cnt = 0; lst = 1;
	ll l = 1, r = n - 1, ans = -1;
	//ask(1); if(!ask(n)) return cout << "= " << n << endl, assert(C == n), void();
	//cerr << l << " " << r << endl;
	ask(st);
	while(l <= r) {
		ll mid = l + (r - l) / 2;
		//		cerr << l << " " << r << endl;
		if(st + mid > n && st - mid <= 0) st = n > 1 && 2 + mid <= n ? 2 : 1, ask(st);
		ll v = st + mid;
		if(st - mid > 0) {
			v = st - mid;
		}
		if(!ask(v)) l = mid + 1;
		else ans = mid, r = mid - 1;
		st = v; 
	} //cout << "= " << l << endl;
	//cerr << n << " " << l << " " << C << endl;
	//cerr << ans << " " << C << endl;
	if(ans == -1) ans = n;
	assert(ans == C);
	if(cnt <= 64) cout << "A";
	else cout << "WA : " << cnt << " " << n << " " << C << endl, assert(0);
}

mt19937_64 lrnd(time(NULL));

const ll V = 1e18;

void solve() {
	n = lrnd() % V + 1;
	//n = 927894323589982457;
	//n = 911594338711677917;
	C = n; //lrnd() % n + 1;
	ll pos = 1, l = 1, r = n - 1;
	while(l <= r) {
		ll mid = l + (r - l) / 2;
		if(pos + mid > n && pos - mid <= 0) pos = 1;
		pos = pos + mid;
		if(pos - mid > 0) pos = pos - mid;
		l = mid + 1;
	}
	//solve(n - pos - 1);
	//solve(n - pos + 1);
	solve((n + 1) / 3 * 2);
}

signed main() {
#ifndef ONLINE_JUDGE
	//freopen("1.in", "r", stdin);
#endif
	int T = 100000; while(T--) solve();
	return 0;
}
